using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;

[Serializable]

public class PreviewImage : MonoBehaviour
{
    [SerializeField]
    public Image previewImage;
    public Text numText;
    public List<Sprite> imageSprites=new List<Sprite>();

    public void ChangeImage(int type)
    {
        if(type<=imageSprites.Count)
        {
            previewImage.sprite = imageSprites[type];
        }
        else
        {
            Debug.LogWarning("type超出图片数");
        }
    }

    public void ChangeNumText(int num)
    {
        numText.text = num.ToString();
    }
}
